package com.running.base.run.api;


import com.running.base.run.mq.RabbitMqSender;
import com.running.base.run.params.base.ResultBody;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


/**
 * Created by Daniel on 24/02/2017.
 */
@RestController
@RequestMapping("/api/monitor")
public class AliveController {

    private static final Logger logger = LoggerFactory.getLogger(AliveController.class);

    @RequestMapping("/alive")
    public ResultBody alive() throws InterruptedException {
        logger.info("alive ....");
        return ResultBody.success();
    }


    @Resource
    private RabbitMqSender sender;

    @RequestMapping("/mq")
    public ResultBody mq() throws InterruptedException {
        logger.info("mq ....");
        sender.doSendMqMsg("hello world!");
        return ResultBody.success();
    }
}
